package examTest;

public class A {

	String name="A";
	public String getName(){
		
		return this.name;
	}
	
	public String generating(){
		
		return "Class A";
	} 
	public static void main (String args[]){
		A a=new A();
		A b=new B();
		System.out.println(a.generating()+" d "+a.getName());
		System.out.println(b.generating()+" d "+b.getName());
	}
	
	
}

class B extends A {

	String name="B";
	public String generating(){
		
		return "Class B";
	} 
}